package com.topvision.myviewtest.design_patterns.strategy_mode.user;

import com.topvision.myviewtest.design_patterns.strategy_mode.inter.IAttackBehavior;
import com.topvision.myviewtest.design_patterns.strategy_mode.inter.IDefendBehavior;
import com.topvision.myviewtest.design_patterns.strategy_mode.inter.IDisplayBehavior;
import com.topvision.myviewtest.design_patterns.strategy_mode.inter.IRunBehavior;

/**
 * @author lucy
 * @date 2018-10-11 17:00
 * @description //TODO
 */

public class Role {

    private IRunBehavior mIRunBehavior;
    private IDisplayBehavior mIDisplayBehavior;
    private IAttackBehavior mIAttackBehavior;
    private IDefendBehavior mIDefendBehavior;

    public Role setRunBehavior(IRunBehavior iRunBehavior) {
        mIRunBehavior = iRunBehavior;
        return this;
    }

    public Role setDisplayBehavior(IDisplayBehavior iDisplayBehavior) {
        mIDisplayBehavior = iDisplayBehavior;
        return this;
    }

    public Role setAttackBehavior(IAttackBehavior iAttackBehavior) {
        mIAttackBehavior = iAttackBehavior;
        return this;
    }

    public Role setDefendBehavior(IDefendBehavior iDefendBehavior) {
        mIDefendBehavior = iDefendBehavior;
        return this;
    }

    public void display() {
        mIDisplayBehavior.display();
    }

    public void attack() {
        mIAttackBehavior.attack();
    }

    public void run() {
        mIRunBehavior.run();
    }

    public void defend() {
        mIDefendBehavior.defend();
    }
}
